package com.ruoyi.rsikManage.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.rsikManage.domain.VideoDiagnosisDic;
import com.ruoyi.rsikManage.service.VideoDiagnosisDicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("videoDiagnosisDic")
@RestController
public class VideoDiagnosisDicController extends BaseController {
    @Autowired
    VideoDiagnosisDicService videoDiagnosisDicService;

    /**
     * 查询videoDiagnosisDic列表
     */
    //@PreAuthorize("@ss.hasPermi('rsikManage:videoDiagnosisDic:list')")
    @GetMapping("/list")
    public TableDataInfo list(VideoDiagnosisDic videoDiagnosisDic)
    {
        startPage();
        List<VideoDiagnosisDic> list = videoDiagnosisDicService.selectVideoDiagnosisDic(videoDiagnosisDic);
        return getDataTable(list);
    }


    /**
     * 获取videoDiagnosisDic详细信息
     */
    //@PreAuthorize("@ss.hasPermi('rsikManage:videoDiagnosisDic:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return success(videoDiagnosisDicService.selectVideoDiagnosisDicById(id));
    }

    /**
     * 新增videoDiagnosisDic
     */
//    @PreAuthorize("@ss.hasPermi('rsikManage:videoDiagnosisDic:add')")
//    @Log(title = "videoDiagnosisDic", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody VideoDiagnosisDic videoDiagnosisDic)
    {
        return toAjax(videoDiagnosisDicService.insertVideoDiagnosisDic(videoDiagnosisDic));
    }

    /**
     * 修改videoDiagnosisDic
     */
//    @PreAuthorize("@ss.hasPermi('rsikManage:videoDiagnosisDic:edit')")
//    @Log(title = "videoDiagnosisDic", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody VideoDiagnosisDic videoDiagnosisDic)
    {
        return toAjax(videoDiagnosisDicService.updateVideoDiagnosisDicById(videoDiagnosisDic));
    }

    /**
     * 删除videoDiagnosisDic
     */
//    @PreAuthorize("@ss.hasPermi('rsikManage:videoDiagnosisDic:remove')")
//    @Log(title = "videoDiagnosisDic", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(videoDiagnosisDicService.deleteVideoDiagnosisDicByIds(ids));
    }

    /**
     * 导出videoDiagnosisDic列表
     */
/*    @PreAuthorize("@ss.hasPermi('rsikManage:videoDiagnosisDic:export')")
    @Log(title = "videoDiagnosisDic", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, VideoDiagnosisDic videoDiagnosisDic)
    {
        List<VideoDiagnosisDic> list = videoDiagnosisDicService.selectVideoDiagnosisDicList(videoDiagnosisDic);
        ExcelUtil<VideoDiagnosisDic> util = new ExcelUtil<VideoDiagnosisDic>(VideoDiagnosisDic.class);
        util.exportExcel(response, list, "videoDiagnosisDic数据");
    }*/


}
